function [address_i,in_anb]=Q(in_ani,maxa,cap)
% 限幅，量化，地址变换

if  in_ani>=maxa
    in_anb=maxa;
    address_i=cap;
elseif in_ani==0
    in_anb=0;
    address_i=1;
else
    in_anb=in_ani;
    address_i=ceil((in_ani/maxa)*(cap-1))+1;
end
